﻿using Elev.Farmworker.Net;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Elev.Adapter
{
    public class DouBanAdapter
    {
        private static HTTPClientHelper httpClient = null;

        public const string SearchURL = "http://api.douban.com/v2/movie/search?q=";
        public const string GetVideoInfoURL = "http://api.douban.com/v2/movie/subject/";

        public static string SelectVideoKist(string videoName)
        {
            httpClient = new HTTPClientHelper();
            httpClient.Method = "Get";
            httpClient.URL = SearchURL + videoName;
            string message = httpClient.HttpRequest("");
            return message;
        }

        public static string GetVideoInfo(string id)
        {
            httpClient = new HTTPClientHelper();
            httpClient.Method = "Get";
            httpClient.URL = GetVideoInfoURL + id;
            string message = httpClient.HttpRequest("");
            return message;
        }
    }
}
